{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Rental Listing Inquiries Dataset"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1. 直接调用xgboost内嵌的cv寻找最佳的参数n_estimators"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from xgboost import XGBClassifier\n",
    "import xgboost as xgb\n",
    "\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "\n",
    "from sklearn.metrics import log_loss\n",
    "\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 读取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>bathrooms</th>\n",
       "      <th>bedrooms</th>\n",
       "      <th>price</th>\n",
       "      <th>price_bathrooms</th>\n",
       "      <th>price_bedrooms</th>\n",
       "      <th>room_diff</th>\n",
       "      <th>room_num</th>\n",
       "      <th>Year</th>\n",
       "      <th>Month</th>\n",
       "      <th>Day</th>\n",
       "      <th>...</th>\n",
       "      <th>walk</th>\n",
       "      <th>walls</th>\n",
       "      <th>war</th>\n",
       "      <th>washer</th>\n",
       "      <th>water</th>\n",
       "      <th>wheelchair</th>\n",
       "      <th>wifi</th>\n",
       "      <th>windows</th>\n",
       "      <th>work</th>\n",
       "      <th>interest_level</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.5</td>\n",
       "      <td>3</td>\n",
       "      <td>3000</td>\n",
       "      <td>1200.0</td>\n",
       "      <td>750.000000</td>\n",
       "      <td>-1.5</td>\n",
       "      <td>4.5</td>\n",
       "      <td>2016</td>\n",
       "      <td>6</td>\n",
       "      <td>24</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2</td>\n",
       "      <td>5465</td>\n",
       "      <td>2732.5</td>\n",
       "      <td>1821.666667</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2850</td>\n",
       "      <td>1425.0</td>\n",
       "      <td>1425.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>4</td>\n",
       "      <td>17</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>3275</td>\n",
       "      <td>1637.5</td>\n",
       "      <td>1637.500000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>4</td>\n",
       "      <td>18</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3350</td>\n",
       "      <td>1675.0</td>\n",
       "      <td>670.000000</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 228 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   bathrooms  bedrooms  price  price_bathrooms  price_bedrooms  room_diff  \\\n",
       "0        1.5         3   3000           1200.0      750.000000       -1.5   \n",
       "1        1.0         2   5465           2732.5     1821.666667       -1.0   \n",
       "2        1.0         1   2850           1425.0     1425.000000        0.0   \n",
       "3        1.0         1   3275           1637.5     1637.500000        0.0   \n",
       "4        1.0         4   3350           1675.0      670.000000       -3.0   \n",
       "\n",
       "   room_num  Year  Month  Day       ...        walk  walls  war  washer  \\\n",
       "0       4.5  2016      6   24       ...           0      0    0       0   \n",
       "1       3.0  2016      6   12       ...           0      0    0       0   \n",
       "2       2.0  2016      4   17       ...           0      0    0       0   \n",
       "3       2.0  2016      4   18       ...           0      0    0       0   \n",
       "4       5.0  2016      4   28       ...           0      0    1       0   \n",
       "\n",
       "   water  wheelchair  wifi  windows  work  interest_level  \n",
       "0      0           0     0        0     0               1  \n",
       "1      0           0     0        0     0               2  \n",
       "2      0           0     0        0     0               0  \n",
       "3      0           0     0        0     0               2  \n",
       "4      0           0     0        0     0               2  \n",
       "\n",
       "[5 rows x 228 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# path to where the data lies\n",
    "dpath = './data/'\n",
    "train = pd.read_csv(dpath +\"RentListingInquries_FE_train.csv\")\n",
    "train.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 准备数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_train = train['interest_level']\n",
    "\n",
    "train = train.drop(['interest_level'], axis=1, inplace = False)\n",
    "X_train = train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\model_selection\\_split.py:2026: FutureWarning: From version 0.21, test_size will always complement train_size unless both are specified.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "# 训练样本6w+，交叉验证太慢，用train_test_split估计模型性能\n",
    "from sklearn.model_selection import train_test_split\n",
    "X_train_part, X_val, y_train_part, y_val = train_test_split(X_train, y_train, train_size = 0.2,random_state = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9870, 227)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train_part.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## interest_level分布，看看各类样本分布是否均衡"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAELCAYAAAARNxsIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGx5JREFUeJzt3X2wHXWd5/H3h/AgPibIhcokYYKaGUUdo14hypSj6EDAHRMpUChHIkNtxAKF0rUEd5aMPMyM4ygrM8pupogkrkOIiBI1GDMMyII8JGB4CJHlioxcyZJgeNQVivDZP/p35eTm5N7OpU9OTu7nVdV1ur/96z7fwy340v379a9lm4iIiCbs0e0EIiJi95GiEhERjUlRiYiIxqSoREREY1JUIiKiMSkqERHRmBSViIhoTIpKREQ0JkUlIiIas2e3E9jZ9t9/f0+fPr3baURE9JTbbrvtEdt9o7Ubd0Vl+vTprFmzpttpRET0FEn/Uaddbn9FRERjOlZUJL1I0q2S7pC0TtLnS/xSSb+QtLYsM0tcki6SNCDpTklvaTnXPEn3lWVeS/ytku4qx1wkSZ36PRERMbpO3v56GjjC9lOS9gJukHR12fcZ21cMa380MKMshwEXA4dJ2g9YAPQDBm6TtNz2o6XNfOBmYAUwG7iaiIjoio5dqbjyVNncqywjzbM/B1hSjrsZmChpMnAUsMr25lJIVgGzy76X277J1fz9S4C5nfo9ERExuo72qUiaIGktsJGqMNxSdl1QbnFdKGmfEpsCPNhy+GCJjRQfbBNvl8d8SWskrdm0adML/l0REdFeR4uK7S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tLYsx3Q7qW7KkOKIiGhMrlQiIqIxKSoREdGYFJWIiGhMikpERDQmRSUiIhqTohIREY1JUYkAJP2kRpszJb24w3nMHO05B0kflfTPDX9v4+eM8SlFJQKw/Y4azc4EdqiolNcS7IiZwLh+eC56W4pKBCDpqfL5LknXSbpC0s8kfVOVTwJ/AFwr6drS9khJN0m6XdK3yqSCSHpA0jmSbgCOl/RqST+UdJuk/y3ptaXd8ZLulnSHpOvLFDvnAh8qT2Z/qEbefZK+LWl1WQ6XtEfJYWJLuwFJB7Zr3/g/zBjX9ux2AhG7oDcDr6ealPNG4HDbF0n6FPBu249I2h/4a+C9tn8j6bPAp6iKAsDvbP8pgKRrgFNt3yfpMOBrwBHAOcBRtn8laaLtZySdA/TbPr1mrl8BLrR9g6SDgJW2XyfpKuADwNfLdz5g+2FJ/zq8PfC6F/jPK+L3UlQitnWr7UEASWuB6cANw9rMAg4BbqzmFGRvqvm7hlxejn8p8A7gW6UdwD7l80bgUknLgLHObvte4JCWc7+8vIHwcqqi9XWqCUYvH6V9RCNSVCK29XTL+hba/3siYJXtE7dzjt+Uzz2Ax2zPHN7A9qnlKuJ9wFpJ27SpYQ/g7bb/31bJSTcBr5HUB8wFzh+l/Ri+OmJb6VOJqO9JYOj/6m8GDpf0GgBJL5b0R8MPKC9s+oWk40s7SXpTWX+17VtsnwM8QvVOnNbvqONHVDNUU845s3yvge8AX6aalv3XI7WPaEqKSkR9C4GrJV1rexPwUeAySXdSFZnXbue4DwOnSLoDWAfMKfEvSrpL0t3A9cAdwLVUt6dqddQDnwT6Jd0p6R7g1JZ9lwN/yfO3vkZrH/GCZer7iIhoTK5UIiKiMemoj9hFSToZOGNY+Ebbp3Ujn4g6cvsrIiIak9tfERHRmBSViIhoTIpKREQ0JkUlIiIak6ISERGN+f+UQGoL+CmGNwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(y_train);\n",
    "pyplot.xlabel('interest_level');\n",
    "pyplot.ylabel('Number of occurrences');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "各类样本不均衡，交叉验证是采用StratifiedKFold，在每折采样时各类样本按比例采样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# prepare cross validation\n",
    "kfold = StratifiedKFold(n_splits=5, shuffle=True, random_state=3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "默认参数，此时学习率为0.1，比较大，观察弱分类数目的大致范围 （采用默认参数配置，看看模型是过拟合还是欠拟合）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#直接调用xgboost内嵌的交叉验证（cv），可对连续的n_estimators参数进行快速交叉验证\n",
    "#而GridSearchCV只能对有限个参数进行交叉验证\n",
    "def modelfit(alg, X_train, y_train, cv_folds=None, early_stopping_rounds=10):\n",
    "    xgb_param = alg.get_xgb_params()\n",
    "    xgb_param['num_class'] = 9\n",
    "    \n",
    "    #直接调用xgboost，而非sklarn的wrapper类\n",
    "    xgtrain = xgb.DMatrix(X_train, label = y_train)\n",
    "        \n",
    "    cvresult = xgb.cv(xgb_param, xgtrain, num_boost_round=alg.get_params()['n_estimators'], folds =cv_folds,\n",
    "             metrics='mlogloss', early_stopping_rounds=early_stopping_rounds)\n",
    "  \n",
    "    cvresult.to_csv('1_nestimators.csv', index_label = 'n_estimators')\n",
    "    \n",
    "    #最佳参数n_estimators\n",
    "    n_estimators = cvresult.shape[0]\n",
    "    \n",
    "    # 采用交叉验证得到的最佳参数n_estimators，训练模型\n",
    "    alg.set_params(n_estimators = n_estimators)\n",
    "    alg.fit(X_train, y_train, eval_metric='mlogloss')\n",
    "        \n",
    "#     Predict training set:\n",
    "    train_predprob = alg.predict_proba(X_train)\n",
    "    logloss = log_loss(y_train, train_predprob)\n",
    "\n",
    "#     Print model report:\n",
    "    print(\"logloss of train :\" )\n",
    "    print(logloss)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of train :\n",
      "0.42309263472472675\n"
     ]
    }
   ],
   "source": [
    "#params = {\"objective\": \"multi:softprob\", \"eval_metric\":\"mlogloss\", \"num_class\": 9}\n",
    "xgb1 = XGBClassifier(\n",
    "        learning_rate =0.1,\n",
    "        n_estimators=1000,  #数值大没关系，cv会自动返回合适的n_estimators\n",
    "        max_depth=6,\n",
    "        min_child_weight=1,\n",
    "        gamma=0,\n",
    "        subsample=0.5,\n",
    "        colsample_bytree=0.8,\n",
    "        colsample_bylevel=0.7,\n",
    "        objective= 'multi:softprob',\n",
    "        seed=5)\n",
    "\n",
    "modelfit(xgb1, X_train_part, y_train_part, cv_folds = kfold)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'base_score': 0.5,\n",
       " 'booster': 'gbtree',\n",
       " 'colsample_bylevel': 0.7,\n",
       " 'colsample_bytree': 0.8,\n",
       " 'gamma': 0,\n",
       " 'learning_rate': 0.1,\n",
       " 'max_delta_step': 0,\n",
       " 'max_depth': 6,\n",
       " 'min_child_weight': 1,\n",
       " 'missing': None,\n",
       " 'n_estimators': 105,\n",
       " 'nthread': 1,\n",
       " 'objective': 'multi:softprob',\n",
       " 'reg_alpha': 0,\n",
       " 'reg_lambda': 1,\n",
       " 'scale_pos_weight': 1,\n",
       " 'seed': 5,\n",
       " 'silent': 1,\n",
       " 'subsample': 0.5}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xgb1.get_xgb_params()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: from_csv is deprecated. Please use read_csv(...) instead. Note that some of the default arguments are different, so please refer to the documentation for from_csv when changing your function calls\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEXCAYAAABCjVgAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xd4VGX2wPHvmZkUAgmhhJbQmwiCFBWwruhPbOgiwto7uq66zXXV3XVXXeuubS0oKqKrYi9Y1t5QioAgCAjSCS0JJSEJ6ef3x3sThpgGZDKTzPk8z30yt8y9586FOfOW+15RVYwxxhgAX7gDMMYYEzksKRhjjKlgScEYY0wFSwrGGGMqWFIwxhhTwZKCMcaYCpYUjAkiIjeLyFPhjsOYcLGk0MiISAsRWSsi5wYtSxSR9SIyLmjZMBF5V0R2iMhOEVkqIneISCtv/cUiUioiud60WkR+HeLYjxOR9FAeY19UFY+q3qmql4foeGtF5IRQ7DsUGup6NbbPpamzpNDIqGouMBF4SERSvMX3AvNU9TUAERkJfAF8AxykqsnAaKAEGBS0u1mq2kJVWwDjgHtFZHDDnInZFyISCHcMJkqoqk2NcAKmAtOA44BtQMegdV8DD9fy/ouBryst+xY4N2h+DLAE2IlLMv2C1vXzlu30thkTtO4UYCmwC9gIXA80B3YDZUCuN3Wq5rweBd7z3j8H6FmHz+Mg4GNgO7AcGL8/8QD/AJ733tcNUOASYAOwA7gKOAxY5J37I0HH6Ql85l2PLOAFINlb91/vWLu9Y91Qh894LfBn71iFQMCb3+idy3JgVBWfxXBgC+APWvZLYJH3+nBgHpADbAXur+YzPQ5Ir2ZdS+A5IBNYB/wV8Hnr/MB93mewBrjG+xwD1exrLXBCNe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J9zwBAd5X1aqeJZAIvC0i8d52v9/XmIypinVJNcYYU8Gqj4wxxlSw6iPT5InIo7jnOwd7SFWfCUc8xkQyqz4yxhhTwaqPjDHGVLCkYIwxpoIlBWOMMRUsKRhjjKnw/3HaviQaI95jAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "cvresult = pd.DataFrame.from_csv('1_nestimators.csv')\n",
    "        \n",
    "# plot\n",
    "test_means = cvresult['test-mlogloss-mean']\n",
    "test_stds = cvresult['test-mlogloss-std'] \n",
    "        \n",
    "train_means = cvresult['train-mlogloss-mean']\n",
    "train_stds = cvresult['train-mlogloss-std'] \n",
    "\n",
    "x_axis = range(0, cvresult.shape[0])\n",
    "        \n",
    "pyplot.errorbar(x_axis, test_means, yerr=test_stds ,label='Test')\n",
    "pyplot.errorbar(x_axis, train_means, yerr=train_stds ,label='Train')\n",
    "pyplot.title(\"XGBoost n_estimators vs Log Loss\")\n",
    "pyplot.xlabel( 'n_estimators' )\n",
    "pyplot.ylabel( 'Log Loss' )\n",
    "pyplot.savefig( 'n_estimators4_1.png' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>train-mlogloss-mean</th>\n",
       "      <th>train-mlogloss-std</th>\n",
       "      <th>test-mlogloss-mean</th>\n",
       "      <th>test-mlogloss-std</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>n_estimators</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.954251</td>\n",
       "      <td>0.000336</td>\n",
       "      <td>1.963916</td>\n",
       "      <td>0.003822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.777374</td>\n",
       "      <td>0.002894</td>\n",
       "      <td>1.794134</td>\n",
       "      <td>0.003344</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.636663</td>\n",
       "      <td>0.003198</td>\n",
       "      <td>1.658981</td>\n",
       "      <td>0.003786</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.520827</td>\n",
       "      <td>0.003057</td>\n",
       "      <td>1.548987</td>\n",
       "      <td>0.004845</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.423087</td>\n",
       "      <td>0.003430</td>\n",
       "      <td>1.456689</td>\n",
       "      <td>0.005593</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.338786</td>\n",
       "      <td>0.003238</td>\n",
       "      <td>1.377027</td>\n",
       "      <td>0.006285</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1.264965</td>\n",
       "      <td>0.003899</td>\n",
       "      <td>1.307803</td>\n",
       "      <td>0.006226</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1.200977</td>\n",
       "      <td>0.004198</td>\n",
       "      <td>1.247573</td>\n",
       "      <td>0.006366</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1.142806</td>\n",
       "      <td>0.004099</td>\n",
       "      <td>1.193202</td>\n",
       "      <td>0.006369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1.090935</td>\n",
       "      <td>0.004503</td>\n",
       "      <td>1.145209</td>\n",
       "      <td>0.006982</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1.044791</td>\n",
       "      <td>0.004711</td>\n",
       "      <td>1.103255</td>\n",
       "      <td>0.007577</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1.002943</td>\n",
       "      <td>0.004484</td>\n",
       "      <td>1.065215</td>\n",
       "      <td>0.008056</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0.964990</td>\n",
       "      <td>0.004730</td>\n",
       "      <td>1.031374</td>\n",
       "      <td>0.008035</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.931038</td>\n",
       "      <td>0.004544</td>\n",
       "      <td>1.000253</td>\n",
       "      <td>0.008193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0.898794</td>\n",
       "      <td>0.004961</td>\n",
       "      <td>0.971837</td>\n",
       "      <td>0.008735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0.870530</td>\n",
       "      <td>0.005332</td>\n",
       "      <td>0.946875</td>\n",
       "      <td>0.009238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0.844328</td>\n",
       "      <td>0.005489</td>\n",
       "      <td>0.924139</td>\n",
       "      <td>0.009502</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0.819544</td>\n",
       "      <td>0.005739</td>\n",
       "      <td>0.903438</td>\n",
       "      <td>0.009633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>0.797421</td>\n",
       "      <td>0.005961</td>\n",
       "      <td>0.884526</td>\n",
       "      <td>0.009877</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0.776892</td>\n",
       "      <td>0.005970</td>\n",
       "      <td>0.867159</td>\n",
       "      <td>0.010564</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0.758214</td>\n",
       "      <td>0.006214</td>\n",
       "      <td>0.851311</td>\n",
       "      <td>0.010666</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>0.740640</td>\n",
       "      <td>0.006303</td>\n",
       "      <td>0.836549</td>\n",
       "      <td>0.010774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0.724026</td>\n",
       "      <td>0.006280</td>\n",
       "      <td>0.823490</td>\n",
       "      <td>0.010886</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>0.708384</td>\n",
       "      <td>0.006012</td>\n",
       "      <td>0.811150</td>\n",
       "      <td>0.010932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0.694004</td>\n",
       "      <td>0.005781</td>\n",
       "      <td>0.799490</td>\n",
       "      <td>0.011495</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>0.680688</td>\n",
       "      <td>0.005637</td>\n",
       "      <td>0.788932</td>\n",
       "      <td>0.011760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0.667734</td>\n",
       "      <td>0.005742</td>\n",
       "      <td>0.778783</td>\n",
       "      <td>0.011984</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>0.655814</td>\n",
       "      <td>0.005834</td>\n",
       "      <td>0.769897</td>\n",
       "      <td>0.012381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>0.645158</td>\n",
       "      <td>0.005576</td>\n",
       "      <td>0.761697</td>\n",
       "      <td>0.012577</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>0.634495</td>\n",
       "      <td>0.005917</td>\n",
       "      <td>0.753659</td>\n",
       "      <td>0.012595</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>0.422377</td>\n",
       "      <td>0.005396</td>\n",
       "      <td>0.643072</td>\n",
       "      <td>0.011700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>0.419819</td>\n",
       "      <td>0.005189</td>\n",
       "      <td>0.642874</td>\n",
       "      <td>0.011742</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>0.417348</td>\n",
       "      <td>0.005060</td>\n",
       "      <td>0.642476</td>\n",
       "      <td>0.011724</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>0.415049</td>\n",
       "      <td>0.005115</td>\n",
       "      <td>0.642042</td>\n",
       "      <td>0.011739</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>0.412907</td>\n",
       "      <td>0.004604</td>\n",
       "      <td>0.641716</td>\n",
       "      <td>0.011868</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>0.411232</td>\n",
       "      <td>0.004404</td>\n",
       "      <td>0.641554</td>\n",
       "      <td>0.011953</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>0.409131</td>\n",
       "      <td>0.004528</td>\n",
       "      <td>0.641374</td>\n",
       "      <td>0.011874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>0.407034</td>\n",
       "      <td>0.004631</td>\n",
       "      <td>0.641065</td>\n",
       "      <td>0.011836</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>0.404764</td>\n",
       "      <td>0.004781</td>\n",
       "      <td>0.641020</td>\n",
       "      <td>0.011658</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>0.402547</td>\n",
       "      <td>0.004862</td>\n",
       "      <td>0.640753</td>\n",
       "      <td>0.011662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>0.400266</td>\n",
       "      <td>0.004983</td>\n",
       "      <td>0.640521</td>\n",
       "      <td>0.011727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>0.398069</td>\n",
       "      <td>0.004551</td>\n",
       "      <td>0.640433</td>\n",
       "      <td>0.012075</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>0.396207</td>\n",
       "      <td>0.004710</td>\n",
       "      <td>0.640314</td>\n",
       "      <td>0.012289</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>0.394293</td>\n",
       "      <td>0.004867</td>\n",
       "      <td>0.640246</td>\n",
       "      <td>0.012407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>0.391945</td>\n",
       "      <td>0.004816</td>\n",
       "      <td>0.640057</td>\n",
       "      <td>0.012379</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>0.389894</td>\n",
       "      <td>0.004531</td>\n",
       "      <td>0.639856</td>\n",
       "      <td>0.012245</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>0.388202</td>\n",
       "      <td>0.004596</td>\n",
       "      <td>0.639617</td>\n",
       "      <td>0.012356</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>0.386319</td>\n",
       "      <td>0.004762</td>\n",
       "      <td>0.639626</td>\n",
       "      <td>0.012454</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>93</th>\n",
       "      <td>0.384289</td>\n",
       "      <td>0.004961</td>\n",
       "      <td>0.639246</td>\n",
       "      <td>0.012516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>94</th>\n",
       "      <td>0.382687</td>\n",
       "      <td>0.005214</td>\n",
       "      <td>0.639206</td>\n",
       "      <td>0.012763</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>0.380877</td>\n",
       "      <td>0.005401</td>\n",
       "      <td>0.638917</td>\n",
       "      <td>0.012565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>0.378922</td>\n",
       "      <td>0.005239</td>\n",
       "      <td>0.638772</td>\n",
       "      <td>0.012728</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>0.377109</td>\n",
       "      <td>0.005439</td>\n",
       "      <td>0.638763</td>\n",
       "      <td>0.012763</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>0.375011</td>\n",
       "      <td>0.005108</td>\n",
       "      <td>0.638570</td>\n",
       "      <td>0.012812</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>0.373093</td>\n",
       "      <td>0.005078</td>\n",
       "      <td>0.638430</td>\n",
       "      <td>0.012975</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>100</th>\n",
       "      <td>0.370997</td>\n",
       "      <td>0.005030</td>\n",
       "      <td>0.638429</td>\n",
       "      <td>0.012878</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>101</th>\n",
       "      <td>0.368973</td>\n",
       "      <td>0.005175</td>\n",
       "      <td>0.638290</td>\n",
       "      <td>0.012894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>102</th>\n",
       "      <td>0.367454</td>\n",
       "      <td>0.004774</td>\n",
       "      <td>0.638172</td>\n",
       "      <td>0.013021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>103</th>\n",
       "      <td>0.365673</td>\n",
       "      <td>0.004708</td>\n",
       "      <td>0.638263</td>\n",
       "      <td>0.012910</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>104</th>\n",
       "      <td>0.364070</td>\n",
       "      <td>0.004797</td>\n",
       "      <td>0.638086</td>\n",
       "      <td>0.012970</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>105 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              train-mlogloss-mean  train-mlogloss-std  test-mlogloss-mean  \\\n",
       "n_estimators                                                                \n",
       "0                        1.954251            0.000336            1.963916   \n",
       "1                        1.777374            0.002894            1.794134   \n",
       "2                        1.636663            0.003198            1.658981   \n",
       "3                        1.520827            0.003057            1.548987   \n",
       "4                        1.423087            0.003430            1.456689   \n",
       "5                        1.338786            0.003238            1.377027   \n",
       "6                        1.264965            0.003899            1.307803   \n",
       "7                        1.200977            0.004198            1.247573   \n",
       "8                        1.142806            0.004099            1.193202   \n",
       "9                        1.090935            0.004503            1.145209   \n",
       "10                       1.044791            0.004711            1.103255   \n",
       "11                       1.002943            0.004484            1.065215   \n",
       "12                       0.964990            0.004730            1.031374   \n",
       "13                       0.931038            0.004544            1.000253   \n",
       "14                       0.898794            0.004961            0.971837   \n",
       "15                       0.870530            0.005332            0.946875   \n",
       "16                       0.844328            0.005489            0.924139   \n",
       "17                       0.819544            0.005739            0.903438   \n",
       "18                       0.797421            0.005961            0.884526   \n",
       "19                       0.776892            0.005970            0.867159   \n",
       "20                       0.758214            0.006214            0.851311   \n",
       "21                       0.740640            0.006303            0.836549   \n",
       "22                       0.724026            0.006280            0.823490   \n",
       "23                       0.708384            0.006012            0.811150   \n",
       "24                       0.694004            0.005781            0.799490   \n",
       "25                       0.680688            0.005637            0.788932   \n",
       "26                       0.667734            0.005742            0.778783   \n",
       "27                       0.655814            0.005834            0.769897   \n",
       "28                       0.645158            0.005576            0.761697   \n",
       "29                       0.634495            0.005917            0.753659   \n",
       "...                           ...                 ...                 ...   \n",
       "75                       0.422377            0.005396            0.643072   \n",
       "76                       0.419819            0.005189            0.642874   \n",
       "77                       0.417348            0.005060            0.642476   \n",
       "78                       0.415049            0.005115            0.642042   \n",
       "79                       0.412907            0.004604            0.641716   \n",
       "80                       0.411232            0.004404            0.641554   \n",
       "81                       0.409131            0.004528            0.641374   \n",
       "82                       0.407034            0.004631            0.641065   \n",
       "83                       0.404764            0.004781            0.641020   \n",
       "84                       0.402547            0.004862            0.640753   \n",
       "85                       0.400266            0.004983            0.640521   \n",
       "86                       0.398069            0.004551            0.640433   \n",
       "87                       0.396207            0.004710            0.640314   \n",
       "88                       0.394293            0.004867            0.640246   \n",
       "89                       0.391945            0.004816            0.640057   \n",
       "90                       0.389894            0.004531            0.639856   \n",
       "91                       0.388202            0.004596            0.639617   \n",
       "92                       0.386319            0.004762            0.639626   \n",
       "93                       0.384289            0.004961            0.639246   \n",
       "94                       0.382687            0.005214            0.639206   \n",
       "95                       0.380877            0.005401            0.638917   \n",
       "96                       0.378922            0.005239            0.638772   \n",
       "97                       0.377109            0.005439            0.638763   \n",
       "98                       0.375011            0.005108            0.638570   \n",
       "99                       0.373093            0.005078            0.638430   \n",
       "100                      0.370997            0.005030            0.638429   \n",
       "101                      0.368973            0.005175            0.638290   \n",
       "102                      0.367454            0.004774            0.638172   \n",
       "103                      0.365673            0.004708            0.638263   \n",
       "104                      0.364070            0.004797            0.638086   \n",
       "\n",
       "              test-mlogloss-std  \n",
       "n_estimators                     \n",
       "0                      0.003822  \n",
       "1                      0.003344  \n",
       "2                      0.003786  \n",
       "3                      0.004845  \n",
       "4                      0.005593  \n",
       "5                      0.006285  \n",
       "6                      0.006226  \n",
       "7                      0.006366  \n",
       "8                      0.006369  \n",
       "9                      0.006982  \n",
       "10                     0.007577  \n",
       "11                     0.008056  \n",
       "12                     0.008035  \n",
       "13                     0.008193  \n",
       "14                     0.008735  \n",
       "15                     0.009238  \n",
       "16                     0.009502  \n",
       "17                     0.009633  \n",
       "18                     0.009877  \n",
       "19                     0.010564  \n",
       "20                     0.010666  \n",
       "21                     0.010774  \n",
       "22                     0.010886  \n",
       "23                     0.010932  \n",
       "24                     0.011495  \n",
       "25                     0.011760  \n",
       "26                     0.011984  \n",
       "27                     0.012381  \n",
       "28                     0.012577  \n",
       "29                     0.012595  \n",
       "...                         ...  \n",
       "75                     0.011700  \n",
       "76                     0.011742  \n",
       "77                     0.011724  \n",
       "78                     0.011739  \n",
       "79                     0.011868  \n",
       "80                     0.011953  \n",
       "81                     0.011874  \n",
       "82                     0.011836  \n",
       "83                     0.011658  \n",
       "84                     0.011662  \n",
       "85                     0.011727  \n",
       "86                     0.012075  \n",
       "87                     0.012289  \n",
       "88                     0.012407  \n",
       "89                     0.012379  \n",
       "90                     0.012245  \n",
       "91                     0.012356  \n",
       "92                     0.012454  \n",
       "93                     0.012516  \n",
       "94                     0.012763  \n",
       "95                     0.012565  \n",
       "96                     0.012728  \n",
       "97                     0.012763  \n",
       "98                     0.012812  \n",
       "99                     0.012975  \n",
       "100                    0.012878  \n",
       "101                    0.012894  \n",
       "102                    0.013021  \n",
       "103                    0.012910  \n",
       "104                    0.012970  \n",
       "\n",
       "[105 rows x 4 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cvresult"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当前参数调整得到的n_estimators最优值为104"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
